package com.alan.wifishare.view.impl.activity;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import com.alan.wifishare.R;
import com.alan.wifishare.presenter.CNTChangeLinkPS;
import com.alan.wifishare.view.BaseActivity;
import com.alan.wifishare.view.iview.IVCNTChangeLink;

/**
 * @className: CNTChangeLinkActivity
 * @describtion: CNTChangeLinkActivity
 * @author: AlanWang
 * @email: 850267876@qq.com
 * @time: 2016/4/26 19:18
 */
public class CNTChangeLinkActivity extends BaseActivity implements IVCNTChangeLink, View.OnClickListener {

    private CNTChangeLinkPS cntChangeLinkPS = null;
    private EditText cntChangeLinkSSIDEt;
    private EditText cntChangeLinkPwdEt;
    private EditText cntChangeLinkConfirmPwdEt;
    private Button cntChangeLinkSubmitBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.cnt_change_link_layout);
        cntChangeLinkPS = new CNTChangeLinkPS(this);
        initView();
    }

    @Override
    protected void initView() {
        cntChangeLinkSSIDEt = (EditText)findViewById(R.id.cntChangeLinkSSIDEt);
        cntChangeLinkPwdEt = (EditText)findViewById(R.id.cntChangeLinkPwdEt);
        cntChangeLinkConfirmPwdEt = (EditText)findViewById(R.id.cntChangeLinkConfirmPwdEt);
        cntChangeLinkSubmitBtn = (Button)findViewById(R.id.cntChangeLinkSubmitBtn);
    }

    @Override
    public String getLinkSSID() {
        return cntChangeLinkSSIDEt.getText().toString();
    }

    @Override
    public String getLinkPassword() {
        return cntChangeLinkConfirmPwdEt.getText().toString();
    }

    @Override
    public String getLinkConfirmPassword() {
        return cntChangeLinkConfirmPwdEt.getText().toString();
    }

    @Override
    public void changLinkSuccess() {
        toastMsg("Link修改成功！");
    }

    @Override
    public void showProgress() {

    }

    @Override
    public void hideProgress() {

    }

    @Override
    public void toastMsg(String msg) {
        toastMsgShort(msg);
    }

    @Override
    public void onClick(View view) {
        cntChangeLinkPS.submitChangeLink();
    }
}
